// 
//  lang.js
//  firefox
//  
//  Created by Zak on 2008-07-14.
//  Copyright 2008 Ant.com. All rights reserved.
// 

/**
 * Handle localization of JS strings
 */
top.AntLang = 
{
	/**
	 * Get a pointer to the string bundle object
	 */
	get lang()
	{ 
		return $("langstr");
	},

	/**
	 * Return the string corresponding to the given symbol
	 * @param str       The symbol string to translate
	 */
	getString: function (str)
	{
		return this.lang.getString(str);
	},

	/**
	 * Return the formated string corresponding to the given symbol
	 * @param fmt       The format string (printf style)
	 */
	getFormatString: function (fmt)
	{
		var param = new AntArray();

		if (arguments.length > 0)
		{
			param.fromArray(arguments);
			param = param.slice(1);
		}

		return this.lang.getFormattedString(fmt, param);
	}
}

